package com.agent.vpsserver.common.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * 分页对象
 *
 * @author <a href="mailto:ludezh@dingtalk.com"> ludezh </a>
 * @version 1.0.0   2018/12/24,20:19
 * @since 1.0.0     2018/12/24,20:19
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class AdminPageRequestDTO extends AdminRequestDTO {

    private static final long serialVersionUID = -1553989654999614328L;

    @NotNull(message = "页码为空")
    @Range(min = 1, message = "页数最小为1")
    @ApiModelProperty(value = "页码(默认1)")
    protected Integer pageNum = 1;

    @NotNull(message = "每页条数为空")
    @Range(min = 1, max = 100, message = "1 <= 每页条数 <= 1000")
    @ApiModelProperty(value = "每页条数(默认20)")
    protected Integer pageSize = 20;

    @ApiModelProperty(value = "排序[格式:字段名 排序姿势](默认按id/创建时间降序)")
    protected String orderBy;
}
